package com.stone.design.patterns.filter;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Stone
 * @version V1.0
 * @description:
 * @date 4/29/18 22:46
 * @email redsstone@163.com
 */
public class CriteriaComputerNetwork implements Criteria{


    List<Student> mStudents = new ArrayList<>();
    @Override
    public List<Student> meetCriteria(List<Student> students) {

        List<Student> computerNetworkStudents = new ArrayList<>();
        for (Student student : students) {
            if (student.getSpecializedSubject().equals(SpecializedSubjectCode.COMPUTER_NETWORK)) {
                computerNetworkStudents.add(student);
            }
        }
        mStudents = computerNetworkStudents;
        return computerNetworkStudents;
    }

    @Override
    public int getCount() {
        return mStudents.size();
    }


}
